package com.hs.jhzd.service.fp.jni;

import com.sun.jna.Native;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * 指纹jni服务.
 *
 * @author lorien
 *
 */
@Slf4j
@Service
public class FingerprintZZJNIService {
	private FingerprintZZDevUtil devUtil = Native.loadLibrary("IDFingerAPI.dll", FingerprintZZDevUtil.class);

	public int match(byte[] src, byte[] feature, Integer leve) {
		if (src == null || feature == null || src.length < 1 || feature.length < 1) {
			return -999;
		}
		int ret = devUtil.zzMatchFingerprint(src, feature, leve);
		// 大于100为比对成功
		return ret;
	}
//	public int match(byte[] src, byte[] feature, Integer leve) {
//		return 0;
//	}
}
